home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
flyout
/
form2.frm
< prev
next >
Wrap
Text File
|
1995-05-07
|
10KB
|
379 lines
VERSION 2.00
Begin Form frmFlyout
BackColor = &H00C0C0C0&
BorderStyle = 1 'Fixed Single
ClientHeight = 1725
ClientLeft = 3630
ClientTop = 1635
ClientWidth = 2085
ControlBox = 0 'False
Height = 2130
Left = 3570
LinkTopic = "Form2"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 115
ScaleMode = 3 'Pixel
ScaleWidth = 139
Top = 1290
Width = 2205
Begin PictureBox SubClass1
Height = 480
Left = 100
ScaleHeight = 450
ScaleWidth = 1170
TabIndex = 0
Top = 80
Width = 1200
End
Begin Image Image1
Height = 330
Index = 15
Left = 0
Top = 900
Width = 360
End
Begin Image Image1
Height = 330
Index = 14
Left = 1440
Top = 600
Width = 360
End
Begin Image Image1
Height = 330
Index = 13
Left = 1080
Top = 600
Width = 360
End
Begin Image Image1
Height = 330
Index = 12
Left = 720
Top = 600
Width = 360
End
Begin Image Image1
Height = 330
Index = 11
Left = 360
Top = 600
Width = 360
End
Begin Image Image1
Height = 330
Index = 10
Left = 0
Top = 600
Width = 360
End
Begin Image Image1
Height = 330
Index = 9
Left = 1440
Top = 300
Width = 360
End
Begin Image Image1
Height = 330
Index = 8
Left = 1080
Top = 300
Width = 360
End
Begin Image Image1
Height = 330
Index = 7
Left = 720
Top = 300
Width = 360
End
Begin Image Image1
Height = 330
Index = 6
Left = 360
Top = 300
Width = 360
End
Begin Image Image1
Height = 330
Index = 5
Left = 0
Top = 300
Width = 360
End
Begin Image Image1
Height = 330
Index = 4
Left = 1440
Top = 0
Width = 360
End
Begin Image Image1
Height = 330
Index = 3
Left = 1080
Top = 0
Width = 360
End
Begin Image Image1
Height = 330
Index = 2
Left = 720
Top = 0
Width = 360
End
Begin Image Image1
Height = 330
Index = 1
Left = 360
Top = 0
Width = 360
End
Begin Image Image1
Height = 330
Index = 0
Left = 0
Top = 0
Width = 360
End
End
Option Explicit
Dim LastIndexPressed%
Sub Form_Load ()
'
' Set the form's global var LastIndexPressed% to -1.
'
LastIndexPressed% = -1
End Sub
Sub SubClass1_WndMessage (wnd As Integer, msg As Integer, wp As Integer, lp As Long, retval As Long, nodef As Integer)
Dim x% ' X coordinate of the mouse
Dim y% ' Y coordinate of the mouse
Dim row% ' Icon row the mouse is over
Dim column% ' Icon column the mouse is over
Dim image_num% ' The index of the icon the mouse is over
Dim temp_str$ ' Temp var
Dim temp% ' Temp var
'
' Based on the message received...
'
Select Case (msg)
'
' Mouse has moved.
'
Case WM_MOUSEMOVE
'
' Do some common stuff.
'
GoSub WM_DataExtract
'
' Determine the help message to be displayed.
'
If (image_num% < 0) Then
temp_str$ = ""
Else
temp_str$ = gToolbox.icons(gToolbox.tool_selected, (image_num% + 1)).help_str
End If
'
' If the left mouse button is depressed, change the icons as needed.
'
If (wp And MK_LBUTTON) Then
'
' If the image number is different than the index in LastIndexPressed%...
'
If (image_num% <> LastIndexPressed%) Then
'
' Set the previously depressed icon to the normal state. (if needed).
'
If (LastIndexPressed% > -1) Then
frmFlyout!Image1(LastIndexPressed%).Picture = frmToolbox!PicClip1.GraphicCell(gToolbox.icons(gToolbox.tool_selected, (LastIndexPressed% + 1)).icon_index)
End If
'
' If the mouse is over one of the icons in the flyout, show the depressed
' version of the current icon and set the var LastIndexPressed%.
' Otherwise, set the var LastIndexPressed% to -1.
'
If (image_num% > -1) Then
frmFlyout!Image1(image_num%).Picture = frmToolbox!PicClip1.GraphicCell(gToolbox.icons(gToolbox.tool_selected, (image_num% + 1)).icon_index + ICON_DEPRESSED)
LastIndexPressed% = image_num%
Else
LastIndexPressed% = -1
End If
End If
End If
'
' Display the help message in the MDIForm's status line.
'
MDIForm1!Panel.Caption = temp_str$
'
' Left mouse button has been depressed.
'
Case WM_LBUTTONDOWN
'
' Do some common stuff.
'
GoSub WM_DataExtract
'
' Determine the help message to be displayed.
'
If (image_num% < 0) Then
temp_str$ = ""
Else
temp_str$ = gToolbox.icons(gToolbox.tool_selected, (image_num% + 1)).help_str
End If
'
' If the image number is different than the index in LastIndexPressed%...
'
If (image_num% <> LastIndexPressed%) Then
'
' Set the previously depressed icon to the normal state. (if needed).
'
If (LastIndexPressed% > -1) Then
frmFlyout!Image1(LastIndexPressed%).Picture = frmToolbox!PicClip1.GraphicCell(gToolbox.icons(gToolbox.tool_selected, (LastIndexPressed% + 1)).icon_index)
End If
'
' If the mouse is over one of the icons in the flyout, show the depressed
' version of the current icon and set the var LastIndexPressed%.
' Otherwise, set the var LastIndexPressed% to -1.
'
If (image_num% > -1) Then
frmFlyout!Image1(image_num%).Picture = frmToolbox!PicClip1.GraphicCell(gToolbox.icons(gToolbox.tool_selected, (image_num% + 1)).icon_index + ICON_DEPRESSED)
LastIndexPressed% = image_num%
Else